package de.koller.worlders.engine.entity.fog;

import de.koller.oceanFramework.OceanException;
import de.koller.oceanFramework.math.Vec;
import de.koller.worlders.WorldersRoot;
import de.koller.worlders.engine.entity.IRenderable;
import de.koller.worlders.engine.tiles.ITile;
import de.koller.worlders.engine.tiles.Tile;
import de.koller.worlders.engine.util.WLightWeightNode;

public class Fog extends WLightWeightNode implements ITile {

	protected Tile tile;
	private IRenderable visual;
	private final float z;
	
	public Fog() {
		this.z = 1.9f;
	}

	@Override
	public void generate( WorldersRoot root, Object... references ) {
		super.generate( root, references );
		
		if( references.length < 1 || references[0] instanceof Tile == false )
			throw new OceanException( "first argument must be the TileObject!" );
		tile = (Tile)references[0];
	}
	
	public Tile getTile() {
		return tile;
	}

	public float getZ() {
		return z;
	}

	@Override
	public Vec getPosition() {
		return tile.getPosition();
	}

	@Override
	public Vec getSize() {
		return tile.getSize();
	}

	@Override
	public IRenderable getVisual() {
		return this.visual;
	}

	public void setVisual( IRenderable visual ) {
		this.visual = visual;
	}
	
}